package com.javaxxf.dao;

import com.javaxxf.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author xuxiaofei
 * @date 2021年10月02日上午10:42
 * @联系作者：如果你有什么不懂，可以加作者微信 xxf960513 一起交流学习
 */
public interface UserDao {
    @Insert("insert into user(name,password,money)values(#{name},#{password},#{money})")
    void add( User user);
    @Delete("delete from user where id=#{id}")
    void delete(Integer id);
    @Update("uqdate user set name=#{name},password=#{password},money=#{money} where id=#{id}")
    void update(User user);
    @Select("select *from user")
    List<User> findAll();
    @Select("select * from user where id=#{id}")
    User findById(Integer id);
}
